// @ts-nocheck
/*
 * @Descripttion: 胡腾辉 | feico
 * @version: V1.0
 * @Author: feico
 * @Date: 2022-02-23 10:23:41
 * @LastEditors: feico
 * @LastEditTime: 2022-02-23 10:25:57
 */
import React, { useEffect } from 'react'
import { useDispatch } from 'react-redux'
import {Select} from 'antd'
import { useChannels } from '../../hooks'
import { getChannel } from '../../store/action/article'

export default function Channel(props) {
    const dispatch = useDispatch()
    const channels = useChannels()
    useEffect(()=>{
dispatch(getChannel())
    },[dispatch])
        return (
            <Select placeholder='请选择频道' style={{ width: 200 }} {...props}>
            {channels.map((item) => (
                <Select.Option key={item.id} value={item.id}>
                    {item.name}
                </Select.Option>
            ))}
        </Select>
            )
    }